class HotelRoomType < ActiveRecord::Base
  attr_accessible :hotel_id, :is_on_promoted, :max_guest, :idr_price, :usd_price, :idr_promotion_price, :usd_promotion_price, :room_name, :primary_picture

  validates :room_name, :hotel_id, :max_guest, :idr_price, :usd_price, :idr_promotion_price, :usd_promotion_price, :presence => true
  validates :room_name, :uniqueness => {:scope => :hotel_id}
  validates :max_guest, :idr_price, :usd_price, :idr_promotion_price, :usd_promotion_price, :numericality => true

  belongs_to :hotel, foreign_key: "hotel_id"
  has_many :room_type_facilities, dependent: :destroy, foreign_key: "room_type_id" 
  has_many :hotel_room_type_images, dependent: :destroy, foreign_key: "hotel_room_type_id" 
  has_many :hotel_transactions

  mount_uploader :primary_picture, PrimaryRoomUploader
end
